home *** CD-ROM | disk | FTP | other *** search
- Path: tools.bbnplanet.com!not-for-mail
- From: barmar@tools.bbnplanet.com (Barry Margolin)
- Newsgroups: comp.std.c
- Subject: Re: Undefined result vs. int's holding undefined values.
- Date: 8 Jan 1996 21:45:20 -0500
- Organization: BBN Planet Corp., Cambridge, MA
- Message-ID: <4csks0$44p@tools.bbnplanet.com>
- References: <4ck70b$rd7@news.informix.com> <4cmg0s$1mb@der.twinsun.com> <oZA8wQ9ytpjN084yn@csn.net> <4cs460$d6e@news.informix.com>
- NNTP-Posting-Host: tools.bbnplanet.com
-
- In article <4cs460$d6e@news.informix.com>,
- Daniel Wood <dwood@informix.com> wrote:
- >I totally understand what you are doing in the above but this would have to
- >be the ultimate in a cheap out for a vendor. SCO could claim that before
- >ever looking at a test case containing a suspected compiler bug that every
- >arithmetic calculation would have to first have a test similar to the above
- >to protect against overflow/underflow.
-
- I don't think that's a valid analogy. The original code intentionally
- caused overflow, and depended on a particular behavior as a result.
-
- A test case doesn't have to prevent overflows. The submitter of the bug
- report merely has to show that his test values will never cause overflow.
- Most programs don't check for overflow because it's generally impractical
- and unlikely (applications that deal with such large quantities either use
- floating point of arbitrary-length arithmetic libraries).
- --
- Barry Margolin
- BBN PlaNET Corporation, Cambridge, MA
- barmar@bbnplanet.com
- Phone (617) 873-3126 - Fax (617) 873-6351
-